// #ifndef VUE3
import Vue from 'vue'
import App from '/App'

import store from "/store"
import api from "/common/api.js"
import uniCloudCallFunction from "/common/uniCloud.js"
import * as utils from '/common/utils.js'
import zkView from "/components/zkView/zkView.vue"
import zkTabbar from "/components/zkTabbar/zkTabbar.vue"

Vue.config.productionTip = false

Vue.prototype.$http = api
Vue.prototype.$uniCloudCallFunction = uniCloudCallFunction
Vue.prototype.$utils = utils
Vue.prototype.$store = store

Vue.component('zkView', zkView)
Vue.component('zkTabbar', zkTabbar)

App.mpType = 'app'

const app = new Vue({
	store,
	...App
})

app.$mount()
// #endif

// #ifdef VUE3
import {
	createSSRApp
} from 'vue'
import App from '/App.vue'

import store from "/store"
import api from "/common/api.js"
import uniCloudCallFunction from "/common/uniCloud.js"
import * as utils from '/common/utils.js'
import zkView from "/components/zkView/zkView.vue"
import zkTabbar from "/components/zkTabbar/zkTabbar.vue"

export function createApp() {

	const app = createSSRApp(App);

	app.config.globalProperties.$http = api
	app.config.globalProperties.$uniCloudCallFunction = uniCloudCallFunction
	app.config.globalProperties.$utils = utils
	app.config.globalProperties.$store = store

	app.use(store)
	app.component('zkView', zkView)
	app.component('zkTabbar', zkTabbar)

	return {
		app
	}
}
// #endif